# Frierson, Dylan, Lab 4
# 1
USE vbvideo;
SELECT UPPER(StudioName) AS 'Studio Name', Substring(Phone, 5, 8) AS 'Phone Number'
FROM studio;
# 2
USE books;
SELECT CONCAT(FirstName, ' ', LastName) AS 'Full Name', Customernum, IfNull(Referred, 'NOT REFERRED') AS 'Reference'
FROM Customers;
# 3
USE lyric;
SELECT CONCAT(Substring(FirstName, 1, 1), Substring(LastName, 1, 1)) AS "Member Initials"
FROM Members;
# 4 
USE books;
SELECT Title, Cost, Retail, INSERT("%", 1, 0, ROUND(((Retail - Cost) /  Cost) * 100, 0)) AS "Markup Percentage"
FROM Books;
# 5
SELECT DATE_FORMAT(NOW(), '%W, %D of %M in the year %Y at %h:%i%p' ) AS 'Current Time and Date';
# 6
USE vbauto;
SELECT LName, ModelName, FORMAT(CostValue, 2)
FROM Vehicle, Customer
WHERe Vehicle.InventoryID = Customer.InventoryIDNumber;
# 7
USE books;
SELECT DISTINCT LENGTH(ISBN) AS 'ISBN Data Length'
FROM Books;
# 8
USE books;
SELECT OrderDate, IfNull(ShipDate, "NOT SHIPPED") AS "Ship Date", IfNull(TO_DAYS(ShipDate) - TO_DAYS(Orderdate), "NOT SHIPPED") AS 'Days it took to ship', DATE_ADD(OrderDate, INTERVAL 60 DAY) AS 'Payment Date'
FROM Orders;
# 9
USE lyric;
SELECT ArtistName, WebAddress, SubString(WebAddress, 5) AS "NO www."
FROM Artists
WHERE WebAddress IS NOT NULL;
# 10
USE lyric;
SELECT EMail, LOCATE('@', EMail)
FROM Members
WHERE EMail IS NOT NULL;